package flexo.graphic.entity.particle;

import flexo.math.Vector;

public class LinePath implements ParticleAffector
{
	Vector path;
	
	public LinePath(Vector path)
	{
		this.path = path;
	}

	@Override
	public void affect(Particle particle)
	{
		if (!particle.isDead())
		{
			float percentage = particle.getLifePercentage();
			particle.position.x = (path.x * percentage) + particle.origin.x;
			particle.position.y = (path.y * percentage) + particle.origin.y;
			particle.position.z = (path.z * percentage) + particle.origin.z;
		}
	}
}
